<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <ul>
            <li v-for='(item,index) in fruits' :key="index">{{item}}+{{index}}</li>
        </ul>
        <ul>
            <!-- v-if和v-for结合使用 -->
            <li v-if="val == '男'" v-for='(val,key,index) in obj '>{{index}}={{key}}:{{val}}</li>
        </ul>
    </div>
    <script src="../node_modules/vue/dist/vue.min.js"></script>
    <script>
        var vm = new Vue({
            el:'#app',
            data: {
                fruits:['apple','orange','banana'],
                obj:{
                    uname:'刘琦',
                    age:25,
                    sex:'男'
                }
            },
            methods: {
                
            },
        })
    </script>
</body>
</html>